<?php
class MHtmlColumn {
    protected $_id;
    protected $_table;
    protected $_header;
    protected $_visible = true;
    protected $_htmlOptions = array();
    
    public function __construct($table, $id = NULL) {
        $this->_table = $table;
        $this->_id = (isset ($id))?$id:uniqid();
    }
    
    public function renderHeader(){
        return MHtml::tag('th', $this->_htmlOptions, $this->_header);
    }
    
    public function renderBody($rowIndex){
        return MHtml::tag('td', $this->_htmlOptions, $this->_table->getRow($rowIndex));
    }
    
    public function getId() {
        return $this->_id;
    }

    public function setId($_id) {
        $this->_id = $_id;
    }

    public function getTable() {
        return $this->_table;
    }

    public function setTable($_table) {
        $this->_table = $_table;
    }

    public function getHeader() {
        return $this->_header;
    }

    public function setHeader($_header) {
        $this->_header = $_header;
    }

    public function getVisible() {
        return $this->_visible;
    }

    public function setVisible($_visible) {
        $this->_visible = $_visible;
    }

    public function getHtmlOptions() {
        return $this->_htmlOptions;
    }

    public function setHtmlOptions($_htmlOptions) {
        $this->_htmlOptions = $_htmlOptions;
    }


}
?>
